drm/vc4: Fix OOPSes from trying to cache a partially constructed BO.
authorEric Anholt <eric@anholt.net>
Thu, 9 Feb 2017 17:23:34 +0000 (09:23 -0800)
committerpopcornmix <popcornmix@gmail.com>
Mon, 20 Feb 2017 20:31:53 +0000 (20:31 +0000)
commit017320685c58c6904f33efa8d3606d0da08da835
tree1947e4b5ca5d534f0fe315b905927cf91e2d9de8
parentbf382eb30dc90a9ef7f48d279c253f6ffea1679b
drm/vc4: Fix OOPSes from trying to cache a partially constructed BO.

If a CMA allocation failed, the partially constructed BO would be
unreferenced through the normal path, and we might choose to put it in
the BO cache.  If we then reused it before it expired from the cache,
the kernel would OOPS.

Signed-off-by: Eric Anholt <eric@anholt.net>
Fixes: c826a6e10644 ("drm/vc4: Add a BO cache.")
drivers/gpu/drm/vc4/vc4_bo.c